package com.itheima.b;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("D:/img1.jpeg");
        FileOutputStream fos=new FileOutputStream("D:/img2.jpeg");

        int len;
        byte[] bytes=new byte[1024];
        while ((len= fis.read(bytes))!=-1){
            fos.write(bytes);
        }
        fos.close();
        fis.close();
    }
}
